package com.huashi.dealer.modular.business.article.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huashi.dealer.core.util.TimeUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * Store端文章列表项
 */
@Data
public class StoreArticleListVo {

    @Schema(description = "文章ID")
    private Integer articleId;

    @Schema(description = "标题")
    private String articleTitle;

    @Schema(description = "分类ID")
    private Integer categoryId;

    @Schema(description = "分类名称")
    private String categoryName;

    @Schema(description = "封面图ID")
    private Integer imageId;

    @Schema(description = "封面图URL")
    private String imageUrl;

    @Schema(description = "显示方式(10小图 20大图)")
    private Integer showType;

    @Schema(description = "排序")
    private Integer articleSort;

    @Schema(description = "状态(0隐藏 1显示)")
    private Integer articleStatus;

    @Schema(description = "创建时间(秒)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Long createTime;

    @Schema(description = "创建时间(秒)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Long updateTime;

    @Schema(description = "文章内容")
    private String articleContent;

    @Schema(description = "虚拟阅读量")
    private Integer virtualViews;

    public LocalDateTime getCreateTime() {
        return TimeUtil.changeToLocalDateTime(createTime);
    }

    public LocalDateTime getUpdateTime() {
        return TimeUtil.changeToLocalDateTime(updateTime);
    }

    @Schema(description = "实际阅读量")
    private Integer actualViews;

}


